package com.lin.wx.official.account.common;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author linjiang
 * @date 2024/6/24
 * @fn
 */
@Getter
@AllArgsConstructor
public enum WxMessageEnum {
    DEFAULT("default", "系统未开发处理接口的默认处理方式"),
    TEXT("text", "文本消息"),
    EVENT_SUBSCRIBE("event:subscribe", "事件订阅消息"),
    EVENT_VIEW("event:VIEW", "事件订阅消息"),
    ;

    private String msgType;
    private String desc;

    public static WxMessageEnum getByMsgType(String msgType) {
        for (WxMessageEnum wxMessageEnum : WxMessageEnum.values()) {
            if (wxMessageEnum.getMsgType().equals(msgType)) {
                return wxMessageEnum;
            }
        }
        return null;
    }
}
